﻿using System;
using System.Configuration;
using System.Reflection;

namespace CarFactoryMode
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("输入FactoryMode的序号");
            Console.WriteLine("********************************");
            Console.WriteLine("No FactoryMode");
            Console.WriteLine("1 HongQiCarFactory");
            Console.WriteLine("2 BMWCarFacotory");
            Console.WriteLine("********************************");
            // int no = Int32.Parse(Console.ReadLine().ToString());
            //   string factoryType = System.Configuration.ConfigurationManager.AppSettings["No" + no];
            //  CarFactory factory = (CarFactory)Assembly.Load("FactoryMethod").CreateInstance("FactoryMethod." + factoryType);
            CarFactory factory = new HongQiCarFactory();
            Car car = factory.CarCreate();
            car.StartUp();
            car.Run();
            car.Stop();
        }
    }
}
